package com.neusoft.service;

import com.neusoft.dao.ShopCartMapper;
import com.neusoft.entity.ProductOfShopCart;
import com.neusoft.entity.ShopCart;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class ShopCartServiceImpl implements ShopCartService{
    @Autowired
    public ShopCartMapper shopCartMapper;

    @Override
    public Integer addShopCart(ShopCart shopCart) {
        return shopCartMapper.addShopCart(shopCart);
    }

    @Override
    public Integer addProductIntoShopCart(ProductOfShopCart ps) {
        return shopCartMapper.addProductIntoShopCart(ps);
    }

    @Override
    public Integer addProductCount(ProductOfShopCart ps) {
        return shopCartMapper.addProductCount(ps);
    }

    @Override
    public ShopCart findShopCartById(Integer id) {
        return shopCartMapper.findShopCartById(id);
    }

    @Override
    public ShopCart findShopCartByUserId(Integer userId) {
        return shopCartMapper.findShopCartByUserId(userId);
    }

    @Override
    public ProductOfShopCart findProdutOfShopCart(Map<String, Object> map) {
        return shopCartMapper.findProdutOfShopCart(map);
    }
}
